package cn.tedu;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入注册的用户名");
        String username = sc.nextLine();
        System.out.println("请输入注册的密码");
        String password = sc.nextLine();
        /*
        CREATE TABLE user(id INT PRIMARY KEY AUTO_INCREMENT,
                        username VARCHAR(50),password VARCHAR(50));
        * */
        try (Connection conn = DBUtils.getConn()){
            Statement s = conn.createStatement();
            s.executeUpdate("INSERT INTO user VALUES (NULL ,'"+username+"','"+password+"')");
            System.out.println("注册成功!");
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }






        String name = "张三";
        String info = "我叫"+name+"今年30岁";



    }
}
